package com.qf.service;

import com.qf.mapper.UserMapper;
import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

public class UserServiceImpl implements UserService{
//
    private UserMapper userMapper;

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }
    @Override
    public List<User> findALL() {
        List<User> list = userMapper.findUserAll();

//        System.out.println("=====UserServiceImpl1=====" + list);
        return list;
    }
//需要被注入的用户dao全局对象
//    private UserMapper userMapper;
//
//    public UserMapper getUserMapper() {
//        return userMapper;
//    }
//
//    //进行set注入
//    public void setUserMapper(UserMapper userMapper) {
//        this.userMapper = userMapper;
//    }
//
//    @Override
//    public List<User> findALL() {
//        //直接用注入的UserMapper对象
//        List<User> list = userMapper.findUserAll();
//        return list;
//    }
}
